package com.lt.bcra.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lt.bcra.mapper.BcraModuleMapper;
import com.lt.bcra.entity.BcraModule;
import com.lt.bcra.service.BcraModuleService;
import com.lt.bcra.result.ResultData;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 模块设计表 服务实现类
 * </p>
 *
 * @author LuoTian
 * @since 2022-05-25
 */
@Service
public class BcraModuleServiceImpl extends ServiceImpl<BcraModuleMapper, BcraModule> implements BcraModuleService {

    @Autowired
    private BcraModuleMapper bcraModuleMapper;


    @Override
    public ResultData<List<BcraModule>> selectByQuestionnaireId(Integer questionnaireId) {
        QueryWrapper<BcraModule> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("questionnaire_id",questionnaireId);

        List<BcraModule> bcraModules = bcraModuleMapper.selectList(queryWrapper);

        return ResultData.getResult(bcraModules);
    }
}
